<?php
if (isset($members)) {
    ?>
    <section class="panel">
        <header class="panel-heading">
            <div class="row">
                <div class="col-xs-4">
                    <?php echo $group['OrganisationGroupType']['name'] . ' - ' . $group['OrganisationGroup']['name']; ?>
                </div>
                
                <div class="col-xs-4"></div>

                <div class="col-xs-4">
                    <div class="input-group">
                        <input type="text" class="input-sm form-control" placeholder="Search">
                        <span class="input-group-btn">
                            <button class="btn btn-sm btn-white" type="button">Go!</button>
                        </span>
                    </div>
                </div>
            </div>
        </header>

        <table class="table table-bordered table-condensed table-striped">
            <thead>
                <tr>
                    <th width="40" class="text-center"><input type="checkbox" /></th>
                    <th width="200">Name</th>
                    <th width="150">Mobile Number</th>
                    <th width="200">Email</th>
                    <th width="120">Date of Birth</th>
                    <th>Actions</th>
                </tr>
            </thead>

            <tbody>
                <?php
                foreach ($members as $org_group_member) {
                    $member = $org_group_member['Member'];
                    ?>
                    <tr>
                        <td class="text-center">
                            <input type="checkbox" />
                        </td>
                        <td><?php echo $member['full_name']; ?></td>
                        <td><?php echo $member['mobile_number']; ?></td>
                        <td><?php echo $member['email']; ?></td>
                        <td><?php echo $member['dob']; ?></td>
                        <td>
                            <button class="btn btn-xs btn-white">Edit</button>
                        </td>
                    </tr>
                <?php } ?>
            </tbody>
        </table>

        <footer class="panel-footer">
            <div class="row">
                <div class="col-sm-4 hidden-xs">
                    <select class="input-sm form-control input-s-sm inline">
                        <option value="0">Bulk action</option>
                        <option value="1">Delete selected</option>
                        <option value="2">Bulk edit</option>
                        <option value="3">Export</option>
                    </select>
                    <button class="btn btn-sm btn-white">Apply</button>                  
                </div>
                <div class="col-sm-4 text-center">
                    <small class="text-muted inline m-t-sm m-b-sm">showing 20-30 of 50 items</small>
                </div>
                <div class="col-sm-4 text-right text-center-xs">                
                    <ul class="pagination pagination-sm m-t-none m-b-none">
                        <li><a href="#"><i class="fa fa-chevron-left"></i></a></li>
                        <li><a href="#">1</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#">3</a></li>
                        <li><a href="#">4</a></li>
                        <li><a href="#">5</a></li>
                        <li><a href="#"><i class="fa fa-chevron-right"></i></a></li>
                    </ul>
                </div>
            </div>
        </footer>
    </section>
<?php } else { ?>

    <div class="wrapper">
        <div class="col-lg-l2">
            <h3>No Records Found</h3>
            <p>Please assign members to this group and try again.</p>
        </div>
    </div>
    <?php
}
?>